/*  Copyright (C) 2012 Vladimir M. <mlvl.jr@gmail.com>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; by version 2 of the License.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 */

import QtQuick 2.0

BorderImage {
    id: hand

    //0..59
    property int tick

    property real tailRatio
    property real marginRatio: 0.2

    property bool keepAspectRatio: true

    height: parent.height/2.0*(1 - marginRatio + tailRatio)
    width: keepAspectRatio? implicitWidth/implicitHeight*height: implicitWidth

    x: parent.width/2.0 - width/2.0
    y: parent.height/2.0*marginRatio

    smooth: true
    antialiasing: true

    transform: Rotation {
        origin.x: hand.width/2
        origin.y: hand.height - hand.parent.height/2.0*hand.tailRatio
        angle: 360.0*hand.tick/60
    }
}
